package lista1;

import junit.framework.TestCase;

public class ZamianaTest extends TestCase {

	Zamiana z = null;
	
	protected void setUp() throws Exception {
		z = new Zamiana();
	}

	protected void tearDown() throws Exception {
		z = null;
	}
	/*Sprawdzenie czy obiekt istanieje w referencji*/
	public void testNull() throws Exception
	{
		assertNotNull(z);
	}
	public void testBinary() throws Exception
	{
		String r = z.convert(10, 2);
		assertEquals("1010", r);
	}
	public void testTriary() throws Exception
	{
		String r = z.convert(10, 3);
		assertTrue(r.equals("101"));
	}
	public void testOctany() throws Exception
	{
		String r = z.convert(10, 8);
		assertFalse(!r.equals("12"));
	}
	public void testHexany() throws Exception
	{
		String r = z.convert(15, 16);
		assertEquals("f", r);
	}
	public void testError1() throws Exception
	{
		String r = z.convert(10, 1);
		assertSame("",r);
	}
	public void testError100() throws Exception
	{
		String r = z.convert(10, 100);
		assertNotNull(r);
	}
	

}
